<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台列表</title>
    <link rel="stylesheet" href="${base}/layui/css/layui.css">
    <link rel="stylesheet" href="${base}/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${base}/css/admin.css">
    <style>
    	.layui-bg-black{        width: 200px;height: 136px;margin-right: 30px;float: left;text-align: center;font-size: 33px;color: #000000!important;padding-top: 30px;}
    	.hide {display: none;}
    	.checkbox{display: inline-block;}
    	.width180 {width: 160px;margin-right: 5px;float: left;}
    	.layui-form-item{font-size: 18px;}
    </style>
</head>
<body  class="layui-layout-body" style="overflow:scroll;">
<#include "/common/left.flt">	
<div class="layui-main" style="position: absolute;left: 205px;top: 20px; width: calc(100% - 210px);" >
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
  <legend>操作提示</legend>
</fieldset>
<div class="layui-form hide" id="discuss" style="padding-top:20px;padding-right:20px;">
  <div class="layui-form-item">
    <label class="layui-form-label">帖子id</label>
    <div class="layui-input-block">
       <input name="card_id" id="card_id" class="layui-input layui-text" />
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">评论内容</label>
    <div class="layui-input-block">
      <input name="content" id="content" placeholder="请输入内容" class="layui-input" />
    </div>
  </div>
</div>

<blockquote class="layui-elem-quote layui-quote-nm">
 	<form action="${base}/navy_user/index" method="post" id="dataForm">
        <input placeholder="手机号" name="user_mobile" class="width180 layui-input" value="${user_mobile?default('')}" />
        <button class="layui-btn" lay-submit=""> <span class="fa fa-search"></span>查询</button>
    </form>
</blockquote> 

<table class="layui-table" >
	<thead>
        <tr>
             <th>编号</th>
             <th>登录名</th>
             <th>类别</th>
             <th>昵称</th>
             <th>热度</th>
             <th>性别</th>
             <th>生日</th>
             <th>省份</th>
             <th>添加时间</th>
             <th>会员到期时间</th>
             <th>操作</th>
         </tr>
     </thead>
     <tbody>
     <#list list as one>
     <tr>
     	<td><a href="${base}/users_list/detail?user_id=${one.id}" target="_blank">${one.id}</a></td>
     	<td>${one.user_mobile?default('')}</td>
     	<td>${one.is_true_name?default('')}</td>
     	<td>${one.nick_name?default('')}</td>
     	<td>${one.hot_val?default('')}</td>
     	<td>${one.sex_name?default('')}</td>
     	<td>${one.birthday_string?default('')}</td>
     	<td>${one.area_name?default('')}</td>
     	<td>${one.create_time_string?default('')} </td>
     	<td><#if one.vip_end_time?? ><#if one.vip_end_time gt 0 >${one.vip_end_time_string?default('')}</#if></#if> </td>
     	<td><a href="${base}/navy_user/add_card?user_id=${one.id}" target="_blank" ><span class="fa fa-paper-plane-o" title="发帖"></span></a>
     	<a onclick="discuss(${one.id});" title="评论帖子" target="_blank"><span class="fa fa-comments-o"></span></a> |
     	<a href="${base}/navy_user/discuss_list?user_id=${one.id}" title="帖子评论"  target="_blank"> 评论(${one.num2?default('0')})</a>|
     	<a href="${base}/chat_im?user_id=${one.id}" title="发起聊天"  target="_blank">发起聊天</a>
     	</td>
     </tr>
     </#list>
     </tbody>
</table>
<div id="pageDiv"></div>
<form action="${base}/util/uploadFile" method="post" name="uploadForm" enctype="multipart/form-data" id="uploadForm" class="hide" >
    <input name="pic" type="file" id="pic" class="hide"/>
</form>
</body>
<script src="${base}/js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${base}/layui/layui.all.js"></script>
<script type="text/javascript">
function discuss(user_id){
	layer.open({
	    type: 1 ,
	    title: '用户' + user_id +'评论', 
	    area: ['600px', '400px'],   //宽高
	    shade: 0.4,   //遮罩透明度
	    content: $("#discuss"),
	    btn: ['确定'], //按钮组
	    scrollbar: false ,//屏蔽浏览器滚动条
	    yes: function(index){
	    	var card_id = $("#card_id").val();
	    	var content = $("#content").val();
	    	if (content){
	    		$.post("${base}/navy_user/giveDiscuss",
				   		{"card_id":card_id,"user_id":user_id,"content":content,"type":0},function(data){ 
				   			layer.alert(data);
				   			$("#discuss").hide();
				   		}
				 );	
	    	}
	        layer.close(index);
	        
	        $("#discuss").hide();
	    },
		cancel: function(){
			$("#discuss").hide();        
	    }
	});
}
</script>
</html>